//
//  UIColor+Extension.swift
//  SwiftProject
//
//  Created by qindong on 2021/3/22.
//

extension UIColor {
    // MARK: - RGB统一给个增量 如果合计超出255 则不变
    func colorWithChange(_ fixedValue : CGFloat) -> UIColor {
        UIColor(red: qmui_red - fixedValue / 255.0 < 0 ? qmui_red : qmui_red - fixedValue / 255.0,
                green: qmui_green - fixedValue / 255.0 < 0 ? qmui_green : qmui_green - fixedValue / 255.0,
                blue: qmui_blue - fixedValue / 255.0 < 0 ? qmui_blue : qmui_blue - fixedValue / 255.0,
                alpha: 1)
    }
    
    static func colorMake(_ red : CGFloat, _ green : CGFloat, _ blue : CGFloat, alpha : CGFloat = 1) -> UIColor {
        UIColor(red: red / 255.0, green: green / 255.0, blue: blue / 255.0, alpha: alpha / 1.0)
    }
}
